/**
 * @desc 招财宝首页
 * @author jiguang
 * @mail jiguang1984@gmail.com
 * @date 4/20/14.
 */

$(function(){

    // 点亮图标提示
    $('#icon_wrap_badge').find('i').mouseenter(function(e){

        $('#layer_badge').show().css({
            top: $(e.target).position().top - 42,
            left: $(e.target).position().left -20
        });

    });

    // 余额图标提示
    $('#layer_price_trigger').mouseenter(function(e){

        $('#layer_price').show().css({
            top: $(e.target).position().top - 42,
            left: $(e.target).position().left -16
        });

    });

    // 全局隐藏浮层
    $(document).on('click', function(){
        $('#layer_badge, #layer_badge_on, #layer_price').hide();
    });

    // 模拟下拉菜单
    $('.jijin_select_wrap').on('click', function(){
       $(this).toggleClass('jijin_select_unfold')
           .addClass('jijin_select_selected')
           .siblings().removeClass('jijin_select_selected');
    });
});
